package com.tidc.commonality.api;

import com.tidc.commonality.fallbackFactory.StudentFoundProviderFallback;
import com.tidc.commonality.ov.UserOV;
import com.tidc.commonality.pojo.Matchs;
import com.tidc.commonality.pojo.Works;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassNmae StudentFoundController
 * @Description TODO
 * @Author 冯涛滔
 **/
@FeignClient(name = "FOUNDPROVIDER",fallbackFactory = StudentFoundProviderFallback.class)
public interface StudentFoundApi {
	@ApiOperation("学生报名比赛的接口需要比赛的所有信息包含name brief和works_matchs_id logo url" )
	@RequestMapping(value = "/student/found/match",method = RequestMethod.POST)
	public UserOV foundWorks(@RequestParam("works") Works works, @RequestParam("token") String token);

	@ApiOperation("学生修改自己的项目") //需要将文件上传之后将之前的文件删除
	@RequestMapping(value = "/student/found/match",method = RequestMethod.PUT)
	public UserOV putWorks(@RequestParam("works") Works works,@RequestParam("token")String token);

	@ApiOperation("学生为自己的队伍增加队员 需要队员的email 和 队伍的id")
	@RequestMapping(value = "/student/add/member",method = RequestMethod.POST)
	public UserOV addMenber(@RequestParam("token") String token,@RequestParam("email")String email ,@RequestParam("id")int id);




	@ApiOperation("创建比赛 需要:name(比赛名称) brief(比赛简介)  domain(比赛的领域范围) time(比赛报名结束时间)")
	@RequestMapping(value = "/teacher/found/match",method = RequestMethod.POST)
	public UserOV foundMatch(@RequestParam("token")String token,@RequestBody Matchs matchs);

	@ApiOperation("增加评分老师的,需要被添加的老师的email和比赛的id")
	@RequestMapping(value = "/teacher/add/power",method = RequestMethod.POST)
	public UserOV addTeacher(@RequestParam("token")String token, @RequestParam("email")String email, @RequestParam("id") int id);

	@ApiOperation("修改比赛项目,")
	@RequestMapping(value = "/teacher/alter/match",method = RequestMethod.PUT)
	public UserOV putMatch(@RequestParam("token")String token, @RequestBody Matchs matchs);
}
